#!/bin/bash
function warning {
  echo -e "\e[33m$1\\e[39m"
}

function check-armhf() {
  ARMHF="$(dpkg --print-foreign-architectures | grep "armhf")"
}

purge_packages || exit 1

# remove deprecated key locations
sudo rm -f /usr/share/keyrings/box86-debs-archive-keyring.gpg /etc/apt/trusted.gpg.d/box86-debs-archive-keyring.gpg

rm_external_repo "box86"

if [ "$arch" == 64 ]; then
  # remove armhf architecture if no packages from it are currently installed
  apt list --installed | awk '$3 == "armhf" { print }' | grep -q installed || sudo dpkg --remove-architecture armhf
fi
